
import logging
import logging.handlers


LOG_FILENAME = '/tmp/flash-crawler.log'

# Set up a specific logger with our desired output level
my_logger = logging.getLogger('crawler')
my_logger.setLevel(logging.DEBUG)

# Add the log message handler to the logger
handler = logging.handlers.RotatingFileHandler(
              LOG_FILENAME, maxBytes=100000000, backupCount=5)

formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s")
handler.setFormatter(formatter)

my_logger.addHandler(handler)


def debug(s):
    my_logger.debug(s)

def info(s):
    my_logger.info(s)

def error(s):
    my_logger.error(s)


